package com.doucat.support.model;


import com.doucat.support.model.inter.InterfaceView;

import java.util.List;

/**
 * -----------------------------------------------------------------
 * Copyright (C) 2014-2016, by your company, All rights reserved.
 * -----------------------------------------------------------------
 * File: ResourceView.java
 * Author: win7
 * Version: V100R001C01
 * Create: 2020/9/3 12:01
 * Changes (from 2020/9/3)
 * -----------------------------------------------------------------
 * 2020/9/3 : Create ResourceView.java (win7);
 * -----------------------------------------------------------------
 */
public abstract class BaseView<T> implements InterfaceView<T> {
    public InterfaceView activity;

    public BaseView(InterfaceView activity) {
        this.activity = activity;
    }

    @Override
    public void onStartRequest() {
        if(activity!=null){
            activity.onStartRequest();
        }
    }

    @Override
    public void onResponse() {
        if(activity!=null){
            activity.onResponse();
        }
    }

    @Override
    public void onSuccess(String str) {
        if(activity!=null){
            activity.onSuccess(str);
        }
    }

    @Override
    public void onFail(String str) {
        if(activity!=null){
            activity.onFail(str);
        }
    }

    @Override
    public void onFailure(String str) {
        if(activity!=null){
            activity.onFailure(str);
        }
    }

    @Override
    public void onData(List<T> data) {
        if(activity!=null){
            activity.onData(data);
        }
    }
}
